<!DOCTYPE html>
<html>
<#include "include/header.html"/>
<body id="others">
  <div class="page">
   <header id="header">
    </header>
    <div class="content">
      <div class="desc">
        <h3>我就是小样君</h3>
        <p>轻运动更快乐，小样乳酸盐为冠军带盐</p>
      </div>

      <div class="list-wrap" >
        <ul id="rob_pocket">
        </ul>
        <div id="morePage">
        <#if pageNumber lt totalPage > 
        <img id="more_page" src="${ctx}/resource/images/others/btn.png" onclick="nextPage(${pageNumber!},'${pocket_id!}'); return false;" class="more"> <!-- 加载更多按钮 -->
        </#if>
        </div>
        
      </div>
      
    </div>
  </div>
  <script type="text/javascript">
  var htm="";
  <#if robPocketList ??>
  <#list robPocketList as robPocket>
  var user_name="${robPocket.user_name!}";
  htm+="<li>";
  htm+="<div class='avatar' style='background-image: url(${robPocket.head_pic!});'></div>";
   htm+="<div class='center'>";
   htm+="<span class='name'>"+decodeURI(user_name)+"</span>";
   htm+="<span class='time'>${robPocket.df_time!}</span>";
   htm+="</div>"; 
   htm+="<div class='right'>${robPocket.get_currency!}个</div>";
   htm+="</li>";         
  </#list>
  $("#rob_pocket").html(htm);
  </#if>
  function nextPage(page,pocket_id){
    statistics(); //cnzz统计
    $("#more_page").remove();
    $.post("${ctx}/home/PocketRecord",{
       page:page+1,
       type:1,
       pocket_id,pocket_id
    },function(json){
      var jsonHtm="";
      var pageHtm="";
      var list=json.list;
      for(var i in list){
      jsonHtm+="<li>";
      jsonHtm+="<div class='avatar' style='background-image: url("+list[i].head_pic+");'></div>";
      jsonHtm+="<div class='center'>";
      jsonHtm+="<span class='name'>"+decodeURI(list[i].user_name)+"</span>";
      jsonHtm+="<span class='time'>"+list[i].df_time+"</span>";
      jsonHtm+="</div>"; 
      jsonHtm+="<div class='right'>"+list[i].get_currency+"个</div>";
      jsonHtm+="</li>";
      }
       if(json.pageNumber < json.totalPage){
				pageHtm+="<img id=\"more_page\" src=\"${ctx}/resource/images/others/btn.png\" onclick=\"nextPage("+json.pageNumber+",'${pocket_id!}'); return false;\" class=\"more\">";
			}
		$("#rob_pocket").append(jsonHtm);	
		$("#morePage").html(pageHtm);	
		
    });
    
  }
  </script>
</body>
</html>